package mappedClass;

// Generated 3 juil. 2014 12:40:01 by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Taskdailyreporting generated by hbm2java
 */
@Entity
@Table(name = "taskdailyreporting", catalog = "test", uniqueConstraints = @UniqueConstraint(columnNames = {
		"userId", "taskId" }))
public class TaskDailyReporting implements java.io.Serializable {

	private Date currentDate;
	private UserTask userTask;
	private int point;

	public TaskDailyReporting() {
	}

	public TaskDailyReporting(Date currentDate, UserTask userTask, int point) {
		this.currentDate = currentDate;
		this.userTask = userTask;
		this.point = point;
	}

	@Id
	@Temporal(TemporalType.DATE)
	@Column(name = "currentDate", unique = true, nullable = false, length = 10)
	public Date getCurrentDate() {
		return this.currentDate;
	}

	public void setCurrentDate(Date currentDate) {
		this.currentDate = currentDate;
	}

	@EmbeddedId
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "userId", referencedColumnName = "userId", nullable = false),
			@JoinColumn(name = "taskId", referencedColumnName = "taskId", unique = true, nullable = false)
			})
	public UserTask getUsertask() {
		return this.userTask;
	}

	public void setUsertask(UserTask userTask) {
		this.userTask = userTask;
	}

	@Column(name = "point", nullable = false)
	public int getPoint() {
		return this.point;
	}

	public void setPoint(int point) {
		this.point = point;
	}

	@Override
	public String toString() {
		return "TaskDailyReporting [currentDate=" + currentDate + ", userTask="
				+ userTask + ", point=" + point;
	}

}
